package com.woniuxy.commons.service.sale;

import com.woniuxy.commons.entity.purchaseManager.PurchaseOrderEntity;
import com.woniuxy.commons.entity.purchaseManager.dto.PurchaseOrderGoodsEditDTO;
import com.woniuxy.commons.result.Result;
import com.woniuxy.commons.service.sale.factory.PurchaseManagerServiceFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Description : purchaseOrder openfeign
 * ChangeLog : 1. 创建 (2022/4/25 14:56 [CHL]);
 **/
@FeignClient(name = "purchaseManager", fallbackFactory = PurchaseManagerServiceFactory.class)
public interface PurchaseManagerService {

    @ApiOperation(value = "查询所有需求单列表")
    @GetMapping("/need/need/all")
    public Result<Object> selectAll();

    @ApiOperation(value = "获取采购单信息")
    @GetMapping("/need/purchaseorder/getPurchaseOrderGoodsEditData/{purchaseOrderId}")
    public Result<PurchaseOrderEntity> getPurchaseOrder(@PathVariable("purchaseOrderId") Integer purchaseOrderId);

    @ApiOperation(value = "获取采购单对应商品信息")
    @GetMapping("/need/purchaseorder/getPurchaseOrderGoodsByOrderId/{purchaseOrderId}")
    public Result<PurchaseOrderGoodsEditDTO> getPurchaseOrderGoodsByOrderId(@PathVariable("purchaseOrderId") Integer purchaseOrderId);
}
